package com.maiworld.seller.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.maiworld.mapper.TbFansMapper;
import com.maiworld.pojo.TbFans;
import com.maiworld.seller.service.FansService;

@Service
public class FansServiceImpl implements FansService {

	@Autowired
	private TbFansMapper tbFansMapper;

	//用户的粉丝数据信息返回
	@Override
	public Map<String, Object> findOne(String openid, Long sid) {
		// TODO Auto-generated method stub
		Map<String, Object> result = new HashMap<String, Object>();
		List<TbFans> list = tbFansMapper.selectByFans(sid);
		int number = list.size();
		result.put("fans_details", list);
		result.put("number", number);
		result.put("statusCode", 200);
		result.put("message", "成功");
		return result;
	}


	
	/*	@Override
	public ResultVO<FansDTO> findOne(String openid){
		ResultVO<FansDTO> result = new ResultVO<>();
		FansDTO fansDTO = new FansDTO();
		if(openid==null && openid==""){
			result.setCode(0);
			result.setMsg("没有此学员的信息");
			result.setData(null);
			return result;
		}
		
		TbFans selectByFans = tbFansMapper.selectByFans(openid);
		if(selectByFans==null){
			result.setCode(0);
			result.setMsg("没有此学员的信息");
			result.setData(null);
			return result;
		}
		fansDTO.setTbFans(selectByFans);
			result.setCode(1);
			result.setMsg("有此学员的信息");
			result.setData(fansDTO);
			return result;
		
	} */
}
